		<div class="container top">
			<div class="bg clearfix" style="background: url({{asset('center/personal/images/13.jpg')}}) center;">
				<form id="fftouxiang" enctype="multipart/form-data" method="post" action="url('usersCenter/ajaxtouxiang')">
				<div class="personalImgTotal pull-left">
					<a href="">
						@if($avatar[0]->avatar)
						<img src="{{asset('storage').$avatar[0]->avatar}}" alt="" class="personalImg">
						@else
						<img src="{{asset('public/images/cardContent1.JPEG')}}" alt="" class="personalImg">
						@endif
					</a>
						<input type="file" class="fileNone" id="touxiang" name="avatar">
				</div>
			</form>
				<div class="pull-left pmTotal">
					<!-- 有bug 如果会员未发过帖这个就回出现问题 因为$info是空的-->
					<h2 class="personalCall">{{$info[0]->nickname}}</h2>
					<ul class="clearfix pMTotal">
						<li class="personalMessage pull-left">
							<div class="clearfix">
								@if(!$info[0]->sex)
								<i class="fa fa-user faMessage pull-left"></i>
								<span class="pull-left whiteMessage whiteMessage1">性别只能更改一次</span>
								<div class="pull-left clearfix whitted whitted1">
									<span class="pull-left sexMessage"></span>
									<i class="fa fa-edit faMessage pull-left editMessage"></i>
								</div>
								@else
								<i class="fa fa-user faMessage pull-left"></i>
										@if($info[0]->sex==1)
										男
										@else
										女
										@endif
								@endif
								<form id="form_sex" action="{{url('insertSex')}}" method="post" class="pull-left clearfix messageForm messageForm1">
									<input type="text" name="sex" placeholder="只能输入'男'或'女'" style="width:200px;" class="pull-left sex input"  onkeydown="if(event.keyCode==32||event.keyCode==188||event.keyCode==222){return false;}">
									<input type="button" value="提交" class="pull-left clickSubmit clickSubmit1" id="submit_sex">
								</form>
							</div>
						</li>
						<div class="clearfix clear"></div>
						<li class="personalMessage pull-left">
							<div class="clearfix">
								@if(!$info[0]->age)
								<i class="fa fa-child faMessage pull-left"></i>
								<span class="pull-left whiteMessage whiteMessage2">请填写年龄</span>
								<div class="pull-left clearfix whitted whitted2">
									<span class="pull-left ageMessage"></span>
									<i class="fa fa-edit faMessage pull-left editMessage"></i>
								</div>
								@else
								<i class="fa fa-child faMessage pull-left"></i>{{$info[0]->age}} 岁
								@endif
								<form id="form_age" action="{{url('insertAge')}}" method="post" class="pull-left clearfix messageForm messageForm2">
									<input type="text" name="age" placeholder="请输入年龄" class="pull-left age input"  onkeydown="if(event.keyCode==32||event.keyCode==188||event.keyCode==222){return false;}">
									<input type="button" value="提交" class="pull-left clickSubmit clickSubmit2" id="submit_age">
								</form>
							</div>
						</li>
					</ul>
				</div>
			</div>
			<div class="personalNavbar">
				<ul class="personalUl clearfix">
					<li class="pull-left navbarLi">
						@if(Request::url()==url('usersCenter'))
						<a href="{{url('usersCenter')}}" class="navbarA navbarAShadow">主页</a>
						@else
						<a href="{{url('usersCenter')}}" class="navbarA">主页</a>
						@endif
					</li>
					<li class="pull-left navbarLi">
						@if(Request::url()==url('usersPosted'))
						<a href="{{url('usersPosted')}}" class="navbarA navbarAShadow">发帖</a>
						@else
						<a href="{{url('usersPosted')}}" class="navbarA">发帖</a>
						@endif
					</li>
					<li class="pull-left navbarLi">
						@if(Request::url()==url('usersComment'))
						<a href="{{url('usersComment')}}" class="navbarA navbarAShadow">评论</a>
						@else
						<a href="{{url('usersComment')}}" class="navbarA">评论</a>
						@endif
					</li>
				</ul>
			</div>
		</div>
<script src="{{asset('public/js/jquery.min.js')}}"></script>
<script type="text/javascript">
	$("#submit_sex").click(function(){
			$("#form_sex").submit();
	})
	$("#submit_age").click(function(){
		$("#form_age").submit();
	})

	//ajaxtouxiang
	  $('#touxiang').change(function(){
	        var formData = new FormData($("#fftouxiang")[0]);
					  var file = $(this)[0].files[0];
									        $.ajax({
									            url:" {{url('usersCenter/ajaxtouxiang')}}",
									            type: 'POST',
									            data: formData,
															dataType: 'json',
									            async: false,
									            cache: false,
									            contentType: false,
									            processData: false,
									            success: function (data) {
																		if(data.status == 0){
																			$('#touxiang').siblings().find('img').attr('src', URL.createObjectURL(file));
																		}
																		alert(data.msg);
											            }
														})
	  	});
</script>
